import type { LoginDto, VerificationResultDto } from '@/models/authorize';
import type { UserResultDto } from '@/models/user';
import { httpApi } from '@/utils/axios/http';
import url from '@/utils/axios/url';

export function getVerificationCodeApi(): Promise<VerificationResultDto> {
    return httpApi.httpGet({ url: url.account + '/verificationCode' });
}

export function loginApi(input: LoginDto): Promise<UserResultDto> {
    return httpApi.httpPost({ url: url.account + '/login', params: input });
}

export function logoutApi(): Promise<void> {
    return httpApi.httpPost({ url: url.account + '/logout' });
}